#include <stdio.h>

#define tab 4

int main()
{
    int a , bla, ta, pos ;

    bla = 0;
    ta = 0;
    for (pos = 1; (a =getchar()) != EOF; pos++)
        if (a ==' '){
            if (pos % tab != 0)
                ++bla;
            else{
                bla = 0;
                ++ta;
            }
        }else{
            for (; ta > 0; --ta)
                putchar('\t');
            if (a == '\t')
                bla = 0;
            else
                for ( ; bla > 0; --bla)
                    putchar(' ');
            putchar(a);
            if (a == '\n')
                pos = 0;
            else if (a == '\t')
            pos = pos + (tab - (pos -1) % tab) - 1;
        }
        return 0 ;
}
